<?php
/**
 * Description
 * 
 * PHP version 7
 * 
 * @category Custom
 * @package  Custom
 * @author   ryu <mo5467@126.com>
 * @date     2020-04-24 00:05:09
 * @lastTime 2020-05-01 23:06:01
 * @license  https://opensource.org/licenses/MIT MIT License
 * @link     none
 */

namespace Test\Unit;

use Design\Structural\Adapter\Kindle;
use Design\Structural\Adapter\PaperBook;
use Design\Structural\Adapter\EbookAdapter;

class AdapterTest extends \Test\BaseTest
{


    public function testCanTurnPageOnBook()
    {
        $paperBook = new PaperBook();
        $paperBook->open();
        $paperBook->turnPage();

        $this->assertSame(2, $paperBook->getPage());

    }//end testCanTurnPageOnBook()


    public function testCanTurnPageOnKindleAsBook()
    {
        $kindle = new Kindle();
        $book   = new EbookAdapter($kindle);

        $book->open();
        $book->turnPage();

        $this->assertSame(2, $book->getPage());

    }//end testCanTurnPageOnKindleAsBook()


}//end class
